/*
 * fEvent.h
 *
 *  Created on: 2011-3-29
 *      Author: wangchao
 */

#ifndef FEVENT_H_
#define FEVENT_H_

#include "fKeyMapping.h"
#include <w32std.h>

class fEvent
{
public:
    fEvent( );
    ~fEvent( );
};

class fKeyEvent : public fEvent
{
public:
    fKeyEvent( const TKeyEvent & aKeyEvent, TEventCode aType ) :
        _key( ( TfKeyMapping )( aKeyEvent.iScanCode ) ), _type( ( TfKeyEvent )( aType ) ), _KeyEvent( aKeyEvent ), _Type( aType )
    {
    }
    
public:
    TfKeyMapping Key( ) const
    {
        return _key;
    }
    //void SetKey( TfKeyMapping _key )
    //{
    //    this->_key = _key;
    //}
    TfKeyEvent Type( ) const
    {
        return _type;
    }
    
    //void SetType( TfKeyEvent _type )
    //{
    //   this->_type = _type;
    //}
protected:
    TfKeyMapping _key;
    TfKeyEvent _type;
protected:
    const TKeyEvent & _KeyEvent;
    TEventCode _Type;
public:
    
    const TKeyEvent& KeyEvent( ) const
    {
        return _KeyEvent;
    }
    TEventCode EventCode( ) const
    {
        return _Type;
    }
};
enum TPointEventType
{
    //
    EPointEventDown,
    EPointEventUp,
    EPointEventMove,
    EPointEventNoUse
};
class fPointEvent : public fEvent
{
public:
    fPointEvent( const TPointerEvent& aPointerEvent ) :
        _position( aPointerEvent.iPosition ), _type( ( TPointEventType )aPointerEvent.iType )
    {
        
    }
public:
    fPointEvent( const TPoint& pt, int type ) :
        _position( pt ), _type( ( TPointEventType )type )
    {
        
    }
public:
    const TPoint& Position( ) const
    {
        return _position;
    }
    TPointEventType Type( ) const
    {
        return _type;
    }
protected:
    TPoint _position;
    TPointEventType _type;
};
#endif /* FEVENT_H_ */
